<div class="panel panel-default" ng-controller="RtResourceCtrl">
    <div class="panel-heading">
        城际约租 / 约租票池 / 车辆资源{{route.both}}
    </div>
    <toaster-container toaster-options="{'position-class': 'toast-top-right', 'close-button':true}"></toaster-container>
    <div class="row wrapper m-n">
        <form class="form-horizontal ng-pristine ng-valid">
			<div class="form-group col-md-3">
				<div class="col-md-11">
					<input type="text" ng-model="queryMap.code" class="form-control" placeholder="车辆编号">
				</div>
			</div>
			<div class="form-group col-md-3">
				<div class="col-md-11">
					<input type="text" ng-model="queryMap.number" class="form-control" placeholder="车牌号">
				</div>
			</div>
			<div class="form-group col-md-3">
				<div class="col-md-11">
					<div class="input-group">
						<ui-select ng-model="selected.obj" theme="bootstrap">
						<ui-select-match placeholder="选择线路">{{$select.selected.name}}</ui-select-match>
						<ui-select-choices	repeat="org in selected.origin | propsFilter: {name: $select.search}">
						<span ng-bind-html=" org.name | highlight: $select.search"></span>
						</ui-select-choices> </ui-select>
						<span class="input-group-btn">
							<button ng-click="selected.obj = undefined"
								class="btn btn-default">
								<span class="glyphicon glyphicon-trash"></span>
							</button>
						</span>
					</div>
				</div>
			</div>
			<div class="form-group col-md-3">
				<div class="col-md-11">
					<button type="button" class="btn btn-info" ng-click="query()">查询</button>
				</div>
			</div>
		</form>
    </div>
    <div class="table-responsive">
        <table class="table table-striped b-t b-light">
            <thead>
                <tr>
                    <th style="width:10px;"></th>
                    <th style="width:70px;">车辆编号</th>
                    <th style="width:100px;">票数</th>
                    <th style="width:100px;">超发率</th>
                    <th style="width:70px;">当前状态</th>
                    <th style="width:100px">线路</th>
                    <th style="width:80px;">
                        <center>
                            <a href tooltip="添加资源" has-authority="RENT_TICKETS_RESOURCE_ADD"><i class="fa fa-plus fa-fw m-r-xs" ng-click="write('lg',null,'insert')"></i></a>
                        </center>
                    </th>
                </tr>
            </thead>
            <tbody>
                <tr ng-repeat="res in dataList">
                    <td></td>
                    <td>{{res.code}}</td>
                    <td>{{res.tickets}}</td>
                    <td>{{res.rate}}%</td>
                    <td>{{res.status | statusFilter}}</td>
                    <td ng-if="res.routeId == route.id1">{{route.forward}}</td>
                    <td ng-if="res.routeId == route.id2">{{route.backward}}</td>
                    <td>
                        <center>
                            <a href tooltip="删除" has-authority="RENT_TICKETS_RESOURCE_DEL" ng-if="isFree(res)"><i class="fa fa-times fa-fw" ng-click="del('sm', res,'delete')" ></i></a>
                            <a href tooltip="激活或恢复使用"  has-authority="RENT_TICKETS_RESOURCE_UPDATE" ng-if="isFree(res)"><i class="fa fa-play fa-fw" ng-click="activate(res)"></i></a>
                            <a href tooltip="空闲后暂停使用"  has-authority="RENT_TICKETS_RESOURCE_UPDATE" ng-if="!isFree(res)"><i class="fa fa-pause fa-fw" ng-click="stopFlag(res)"></i></a>
                        </center>
                    </td>
                </tr>
                <tr ng-show="!group || dataList.length == 0">
                    <td colspan="7" style="text-align: center;">暂无车辆资源信息</td>
                </tr>
            </tbody>
        </table>
    </div>
    <page-footer/>
</div>